<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <div data-th-replace="layout/head-top"></div>
</head>
<body>
    <div class="wrapper animated fadeInLeft">
        <div class="row">
            <div>
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>订单详情记录信息 <small class="m-l-sm">（价格、订单号、金额、时间等信息）</small></h5>
                        </div>
                        <div class="ibox-content p-xl">
                            <div class="row">
                                <div class="col-sm-12 text-left">
                                    <p>
                                    <strong>订单号：</strong>
                                    <strong class="text-navy" th:text="${details['orderNo']}"></strong>
                                    <strong>下单用户：</strong>
                                    <strong class="text-navy">
                                        <samp data-toggle="tooltip" data-placement="bottom" data-original-title="手机号">
                                            <samp th:if="!${#strings.isEmpty(details['user']['mobile'])}" th:text="${details['user']['mobile']}"></samp>
                                            <samp th:if="${#strings.isEmpty(details['user']['mobile'])}">—</samp>
                                        </samp>/
                                        <samp data-toggle="tooltip" data-placement="bottom" data-original-title="邮箱号">
                                            <samp th:if="!${#strings.isEmpty(details['user']['email'])}" th:text="${details['user']['email']}"></samp>
                                            <samp th:if="${#strings.isEmpty(details['user']['email'])}">—</samp>
                                        </samp>/
                                        <samp data-toggle="tooltip" data-placement="bottom" data-original-title="账号">
                                            <samp th:if="!${#strings.isEmpty(details['user']['loginAccount'])}" th:text="${details['user']['loginAccount']}"></samp>
                                            <samp th:if="${#strings.isEmpty(details['user']['loginAccount'])}">—</samp>
                                        </samp>/
                                        <samp data-toggle="tooltip" data-placement="bottom" data-original-title="昵称">
                                            <samp th:if="!${#strings.isEmpty(details['user']['nickname'])}" th:text="${details['user']['nickname']}"></samp>
                                            <samp th:if="${#strings.isEmpty(details['user']['nickname'])}">—</samp>
                                        </samp>
                                    </strong>
                                    </p>
                                </div>
                                    <div class="col-sm-12 text-right">
                                    <address th:if="${details['shopType']}=='BOOK'">
                                        <strong th:text="'收货人'+${details['orderBook']['addressMap']['userName']}"></strong><br>
                                        <strong title="Phone" th:text="'收货地址：'+${details['orderBook']['addressMap']['address']}"></strong> &nbsp;&nbsp;
                                        <strong title="Phone" th:text="'电话：'+${details['orderBook']['addressMap']['mobile']}"></strong>&nbsp;&nbsp;
                                        <strong title="Phone" th:text="'邮政编号：'+${details['orderBook']['addressMap']['postCode']}"></strong><br/>
                                        <span>
                                            <strong>是否发货：</strong>
                                            <samp th:if="${details['orderBook']['mailStatus']}==2">已发货</samp>
                                            <samp th:if="${details['orderBook']['mailStatus']}!=2">未发货</samp>
                                        </span><br/>
                                        <span th:if="${details['orderBook']['mailStatus']}==2">
                                            <span><strong>物流公司名：</strong>
                                                <samp th:text="${details['orderBook']['mailName']}"></samp>
                                            </span><br/>
                                            <span><strong>货运编号：</strong>
                                                <samp th:text="${details['orderBook']['mailCode']}"></samp>
                                            </span><br/>
                                            <span><strong>是否签收：</strong>
                                                <samp th:if="${details['orderBook']['signStatus']}==2">已签收</samp>
                                                <samp th:if="${details['orderBook']['signStatus']}!=2">未签收</samp>
                                            </span>
                                        </span>
                                    </address>
                                    <p>
                                        <span th:if="${details['orderStatus']}=='INIT'" class="text-navy"><strong>状态：</strong>未支付</span>
                                        <span th:if="${details['orderStatus']}=='SUCCESS'"><strong>状态：</strong>已支付</span>
                                        <span th:if="${details['orderStatus']}=='REFUND'" class="text-navy"><strong>状态：</strong>已退款</span>
                                        <span th:if="${details['orderStatus']}=='CANCEL'" class="text-navy"><strong>状态：</strong>已取消</span><br/>
                                        <span><strong>下单时间：</strong>
                                            <samp th:text="${#strings.substring(details['createTime'],0,16)}"></samp>
                                        </span><br/>
                                        <span>
                                            <strong>支付时间：</strong>
                                            <samp th:text="${#strings.isEmpty(details['payTime'])}?'—':${#strings.substring(details['payTime'],0,16)}"></samp>
                                        </span>
                                        <th:block th:if="${details['detailStatus']}=='REFUND'">
                                            <br/>
                                            <span >
                                                <strong>退款时间：</strong>
                                                <samp class="c-red" th:text="${#strings.isEmpty(details['updateTime'])}?'—':${#strings.substring(details['updateTime'],0,16)}"></samp>
                                            </span>
                                        </th:block>
                                    </p>
                                </div>
                            </div>
                            <div class="table-responsive m-t">
                                <table class="table invoice-table">
                                    <thead>
                                        <tr>
                                            <th>清单</th>
                                            <th>数量</th>
                                            <th>原价</th>
                                            <th>优惠</th>
                                            <th>活动</th>
                                            <th>金额</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <div>
                                                    <strong>
                                                        <samp th:if="${details['shopType']}=='COURSE'" th:text="${details['shop']['course']['courseName']}+'[课程]'"></samp>
                                                        <samp th:if="${details['shopType']}=='BOOK'" th:text="${details['shop']['book']['bookName']}+'[图书]'"></samp>
                                                        <samp th:if="${details['shopType']}=='MEMBER'" th:text="${details['shop']['member']['memberName']}+'[会员]'"></samp>
                                                        <samp th:if="${details['shopType']}=='ACCOUNT'">账户充值</samp>
                                                        <samp th:if="${details['shopType']}=='QA' or ${details['shopType']}=='ATTEND'" th:text="${#strings.length(details['shop']['qa']['context'])}>15?(${#strings.substring(details['shop']['qa']['context'],0,15)}+'...'):${details['shop']['qa']['context']}"></samp>
                                                        <samp th:if="${details['shopType']}=='EXAM'" th:text="${details['shop']['exam']['name']}+'[试卷]'"></samp>
                                                    </strong>
                                                </div>
                                            </td>
                                            <td th:text="${details['buyNum']}"></td>
                                            <td><i class="fa fa-rmb"></i><samp th:text="${details['price']}"></samp></td>
                                            <td>-<i class="fa fa-rmb"></i><samp th:text="${details['yhPrice']}"></samp></td>
                                            <td>-<i class="fa fa-rmb"></i><samp th:text="${details['activityPrice']}"></samp></td>
                                            <td><i class="fa fa-rmb"></i><samp th:text="${details['realPrice']}"></samp></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /table-responsive -->
                            <table class="table invoice-total">
                                <tbody>
                                    <tr>
                                        <td><strong>实付金额：</strong>
                                        </td>
                                        <td><i class="fa fa-rmb"></i>
                                            <samp th:text="${details['realPrice']}"></samp>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><strong>总优惠：</strong>
                                        </td>
                                        <td>- <i class="fa fa-rmb"></i>
                                            <samp th:text="${details['activityPrice']}+${details['yhPrice']}"></samp>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><strong>总计</strong>
                                        </td>
                                        <td><i class="fa fa-rmb"></i>
                                            <samp th:text="${details['realPrice']}"></samp>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div class="text-right">
                                <button class="btn btn-default" id="printPageBtn"><i class="fa fa-print"></i> 打印单据</button>
                            </div>
                            <div class="well m-t">
                                <strong>其它信息：</strong> 打印订单只是需要自己的单据，不提供法理依据。
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script>
        $(function() {
            $('body').on('click', '#printPageBtn', function() {
                window.print()
            });
        })
    </script>
</body>
</html>